package com.hyb.weibo.common.enums;

public enum MessageEnum {

    OK(200,"OK"),

    //------------------------用户模块，通用代码：100xx-----------------------------
    USER_INPUT_USERNAME(10001,"请输入用户名"),
    USER_INPUT_PASSWORD(10002,"请输入密码"),
    //注册 代码：101xx
    REG_OK(OK.getCode(),"注册成功"),
    REG_USER_EXIST(10101,"用户已存在"),

    //登录 代码：102xx
    LOGIN_OK(OK.getCode(),"登录成功"),
    LOGIN_USER_NOT_FOUND(10201,"用户不存在"),
    LOGIN_PASSWORD_ERROR(10202,"密码错误"),





    ;
    private Integer code;
    private String msg;

    MessageEnum(Integer code,String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isOk(){
        return this.code.equals(200);
    }

    public boolean isErr(){
        return !this.isOk();
    }
}
